-
Notifications
You must be signed in to change notification settings - Fork 4
[CI] Rework docs deployment #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e60e6a4 to
dd1cb26
Compare
|
It's working: https://numericalearth.github.io/BreezeDocumentation/previews/PR77/ 🚀 I need to understand why the commit status isn't being reported though (I guess because the deployment is happening in a different repo? I don't know how to link up that one). In the worst case we can manually create a custom status. Edit: I believe that's a bug in |
b8b9d72 to
d99b12b
Compare
|
I have a fix: JuliaDocs/Documenter.jl#2816 🚀
|
|
Great! |
d99b12b to
8d85840
Compare
.github/workflows/Documentation.yml
Outdated
| - uses: actions/create-github-app-token@v2 | ||
| id: generate_token | ||
| # if: ${{ ! github.event.pull_request.head.repo.fork }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is basically ready, the only thing I need to figure out is seeing what happens when a PR is opened from a fork, whether this step fails gracefully (it'd just return an empty token or such) or loudly, making the job fail.
8d85840 to
6d0c930
Compare
navidcy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why lots/most of the doc src files are deleted? Is it still debugging mode?
Yes, I still need to remove the |
521a69c to
907b6fa
Compare
giordano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think this is ready now! The commit status won't work until JuliaDocs/Documenter.jl#2816 makes it into a new release, but we can't do too much about it for the time being (apart from temporarily using a fork, but I'd rather avoid that if possible)
| # Only push previews if all the relevant environment variables are non-empty. This is an | ||
| # attempt to work around https://github.com/JuliaDocs/Documenter.jl/issues/2048. | ||
| push_preview = all(!isempty, (get(ENV, "GITHUB_TOKEN", ""), get(ENV, "DOCUMENTER_KEY", ""))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd need to wait for a PR by dependabot to be sure this is working correctly, but looking at https://github.com/NumericalEarth/Breeze.jl/actions/runs/19032077021/job/54348250773?pr=61#step:5:5 GITHUB_TOKEN isn't empty, but DOCUMENTER_KEY is, so making sure they're both non-empty should be a decent approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just learned about dependabot secrets, in principle we can set DOCUMENTER_KEY for dependabot too, but I think the solution I proposed should be robust in all cases, regardless of whether we decide to set DOCUMENTER_KEY for dependabot or not.
.github/workflows/Documentation.yml
Outdated
| - uses: actions/create-github-app-token@v2 | ||
| id: generate_token | ||
| if: ${{ ! github.event.pull_request.head.repo.fork }} | ||
| with: | ||
| app-id: "${{ secrets.NUMTERRA_BOT_ID }}" | ||
| private-key: "${{ secrets.NUMTERRA_BOT_PRIVATE_KEY }}" | ||
| - uses: julia-actions/julia-docdeploy@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} | ||
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second thought, I'm not entirely sure an app is needed for this, pushing to the other repo happens via DOCUMENTER_KEY. Let me try that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that the app was unnecessary for this task after all. Oh well, we have it set up anyway, we can use it for something else cool!
|
Cool!! Regarding previews: for Oceananigans I had set up all PRs push previews and then have also a GitHub action job that cleans the previews on the Documentation repo. |
Yes, as I mentioned in #82 (comment) we'll move the scheduled cleanup job to the other repo 👍 |
|
Aaaand we're live on the new repo: https://numericalearth.github.io/BreezeDocumentation/ 🥳 |
|
eeeexcellent |

No description provided.